home *** CD-ROM | disk | FTP | other *** search
/ Sprite 1984 - 1993 / Sprite 1984 - 1993.iso / src / lib / c / locale / RCS / setlocale.c,v < prev   
Encoding:
Text File  |  1992-03-27  |  2.7 KB  |  99 lines

  1. head     1.2;
  2. branch   ;
  3. access   ;
  4. symbols  ;
  5. locks    ; strict;
  6. comment  @ * @;
  7.  
  8.  
  9. 1.2
  10. date     92.03.27.13.26.24;  author rab;  state Exp;
  11. branches ;
  12. next     1.1;
  13.  
  14. 1.1
  15. date     91.10.29.16.40.56;  author rab;  state Exp;
  16. branches ;
  17. next     ;
  18.  
  19.  
  20. desc
  21. @@
  22.  
  23.  
  24. 1.2
  25. log
  26. @Removed const so non-ansi compilers will work.
  27. @
  28. text
  29. @/*
  30.  * Copyright (c) 1991 The Regents of the University of California.
  31.  * All rights reserved.
  32.  *
  33.  * Redistribution and use in source and binary forms, with or without
  34.  * modification, are permitted provided that the following conditions
  35.  * are met:
  36.  * 1. Redistributions of source code must retain the above copyright
  37.  *    notice, this list of conditions and the following disclaimer.
  38.  * 2. Redistributions in binary form must reproduce the above copyright
  39.  *    notice, this list of conditions and the following disclaimer in the
  40.  *    documentation and/or other materials provided with the distribution.
  41.  * 3. All advertising materials mentioning features or use of this software
  42.  *    must display the following acknowledgement:
  43.  *    This product includes software developed by the University of
  44.  *    California, Berkeley and its contributors.
  45.  * 4. Neither the name of the University nor the names of its contributors
  46.  *    may be used to endorse or promote products derived from this software
  47.  *    without specific prior written permission.
  48.  *
  49.  * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
  50.  * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
  51.  * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
  52.  * ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
  53.  * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
  54.  * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
  55.  * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
  56.  * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
  57.  * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
  58.  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
  59.  * SUCH DAMAGE.
  60.  */
  61.  
  62. #if defined(LIBC_SCCS) && !defined(lint)
  63. static char sccsid[] = "@@(#)setlocale.c    5.2 (Berkeley) 2/24/91";
  64. #endif /* LIBC_SCCS and not lint */
  65.  
  66. #include <locale.h>
  67. #include <string.h>
  68.  
  69. static char C[] = "C";
  70.  
  71. /*
  72.  * The setlocale function.
  73.  *
  74.  * Sorry, for now we only accept the C locale.
  75.  */
  76. char *
  77. setlocale(category, locale)
  78.     int category;
  79.     char *locale;
  80. {
  81.     if ((unsigned int)category >= _LC_LAST)
  82.         return (NULL);
  83.     if (locale == NULL)
  84.         return (C);
  85.     return(strcmp(locale, C) ? NULL : C);
  86. }
  87. @
  88.  
  89.  
  90. 1.1
  91. log
  92. @Initial revision
  93. @
  94. text
  95. @d51 1
  96. a51 1
  97.     const char *locale;
  98. @
  99.